<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取屏幕大小</title>
    <style>
        #app {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>
<body>
    <div id="app"></div>
    <script>
        const app = document.getElementById('app');
        app.innerHTML = `
            <div>
                屏幕宽度: ${window.screen.width}px
            </div>
            <div>
                屏幕高度: ${window.screen.height}px
            </div>
            <div>
                窗口宽度: ${window.innerWidth}px
            </div>
            <div>
                窗口高度: ${window.innerHeight}px
            </div>
        `;
    </script>
</body>
</html>